﻿using System;
using System.Collections.Generic;
using Amazon.SimpleDB.Model;

namespace ICommonLibrary.Aws.User.Object {

    public class AddAwsUserAccountRequest {
        
        public string Email { get; private set; }
        public List<ReplaceableAttribute> Attributes { get; private set; }

        public AddAwsUserAccountRequest() {
            Attributes = new List<ReplaceableAttribute>();
        }

        public AddAwsUserAccountRequest SetUserRole(AwsUserRole role) {
            Attributes.Add(new ReplaceableAttribute().WithName(AwsUserAccountAttributes.UserRole).WithValue(((int)role).ToString()));
            return this;
        }

        public AddAwsUserAccountRequest SetEmail(string email) {
            Email = email;
            Attributes.Add(new ReplaceableAttribute().WithName(AwsUserAccountAttributes.Email).WithValue(email));
            return this;
        }

        public AddAwsUserAccountRequest SetAwsAccessKey(string accessKey) {
            Attributes.Add(new ReplaceableAttribute().WithName(AwsUserAccountAttributes.AwsAccessKey).WithValue(accessKey));
            return this;
        }

        public AddAwsUserAccountRequest SetAwsSecretKey(string secretKey) {
            Attributes.Add(new ReplaceableAttribute().WithName(AwsUserAccountAttributes.AwsSecretKey).WithValue(secretKey));
            return this;
        }
        public AddAwsUserAccountRequest SetSecurePassword(string securePassword) {
            Attributes.Add(new ReplaceableAttribute().WithName(AwsUserAccountAttributes.SecPassword).WithValue(securePassword));
            return this;
        }

        public AddAwsUserAccountRequest SetName(string name) {
            Attributes.Add(new ReplaceableAttribute().WithName(AwsUserAccountAttributes.Name).WithValue(name));
            return this;
        }

        public AddAwsUserAccountRequest SetDateCreated(DateTime dateCreated) {
            Attributes.Add(new ReplaceableAttribute().WithName(AwsUserAccountAttributes.DateCreated).WithValue(DateUtil.FormatUtc(dateCreated)));
            return this;
        }
    }
}
